package mem

import "unsafe"

func Memset(s unsafe.Pointer, mdata byte, n uintptr) {
	start := uintptr(s)
	end := start + n
	for i := start; i < end; i++ {
		*((*byte)(unsafe.Pointer(i))) = mdata
	}
}

func Memcpy(src unsafe.Pointer, des unsafe.Pointer, n uintptr) {
	start1 := uintptr(src)
	start2 := uintptr(des)
	end1 := start1 + n
	for i, j := start1, start2; i < end1; i, j = i+1, j+1 {
		*((*byte)(unsafe.Pointer(j))) = *((*byte)(unsafe.Pointer(i)))
	}
}
